﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using PlayDeezGames.Common;

namespace ASCII.Common
{
    public class ASCIICell:BoardCellBase<ASCIICell>,IComparable
    {
        private byte character;
        public byte Character
        {
            get
            {
                return character;
            }
            set
            {
                if (character != value)
                {
                    character = value;
                    Dirty = true;
                }
            }

        }
        private ASCIICellColor foregroundColor;
        public ASCIICellColor ForegroundColor
        {
            get { return foregroundColor; }
            set { if (foregroundColor != value) { foregroundColor = value; Dirty = true; } }
        }
        private ASCIICellColor backgroundColor;
        public ASCIICellColor BackgroundColor
        {
            get { return backgroundColor; }
            set { if (backgroundColor != value) { backgroundColor = value; Dirty = true; } }
        }
        public ASCIICell()
            : this(byte.MinValue)
        {
        }
        public ASCIICell(byte theCharacter):this(theCharacter,ASCIICellColor.Gray)
        {
        }
        public ASCIICell(byte theCharacter, ASCIICellColor theForegroundColor):this(theCharacter,theForegroundColor,ASCIICellColor.Black)
        {
        }
        public ASCIICell(byte theCharacter, ASCIICellColor theForegroundColor, ASCIICellColor theBackgroundColor)
        {
            Character = theCharacter;
            ForegroundColor = theForegroundColor;
            BackgroundColor = theBackgroundColor;
            Dirty = true;
        }
        public override void Clear()
        {
            Character = byte.MinValue;
            ForegroundColor = ASCIICellColor.Gray;
            BackgroundColor = ASCIICellColor.Black;
        }
        public override void CopyFrom(ASCIICell theSource)
        {
            base.CopyFrom(theSource);
            Character = theSource.Character;
            ForegroundColor = theSource.ForegroundColor;
            BackgroundColor = theSource.BackgroundColor;
        }

        public int CompareTo(object obj)
        {
            throw new NotImplementedException();
        }
    }
}
